package com.fand.stater.process;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.rocketmq.client.consumer.listener.MessageListener;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @Author: zhangjiabin
 * @Date: 2021/5/27
 * @Version 1.0
 */
public class RocketMQProcessor implements BeanPostProcessor {

    public static Map<String,Object> mapListener = new ConcurrentHashMap<>();

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if(bean instanceof MessageListener){
            mapListener.put(beanName,bean);
        }
        return bean;
    }
}
